package com.wm.cmsService.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wm.cmsService.entity.CrmBanner;
import com.wm.cmsService.service.CrmBannerService;
import com.wm.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author sshdg
 * @since 2020-10-07
 */
@RestController
//@CrossOrigin
@Api(tags = "幻灯片前台")
@RequestMapping("/cmsService/bannerFront")
public class BannerFrontController {
    @Autowired
    CrmBannerService bannerService;

    @ApiOperation("查询所有")
    @GetMapping("/findAll")
    public R findAll(){
        List<CrmBanner> list = bannerService.selectAllBanners();
        return R.ok().data("banners", list);
    }
}

